package com.struts.web.user.manage.system;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.struts.web.user.manage.system.UserStatusForm;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.lg.system.CLGAction;
import com.struts.deal.user.manage.system.SysDeal;

public class UserStatusAction extends CLGAction {
	
	
	public ActionForward execute(ActionMapping actionMapping,
            ActionForm actionForm,
            HttpServletRequest request,
            HttpServletResponse response) throws Exception {
		UserStatusForm aWebForm = (UserStatusForm)actionForm;
		boolean result = false;
		
		if(aWebForm.getMethod()!=null && aWebForm.getMethod().equals("edit")){
			result=SysDeal.editUserStatus(request, response, aWebForm);
			if(result){
			 return actionMapping.findForward("success");
			}else{
				return actionMapping.findForward("fail");
			}
		}else if(aWebForm.getMethod()!=null && aWebForm.getMethod().equals("del")){
			SysDeal.delUser(request, response, aWebForm);
			return actionMapping.findForward("index");
		}
		else{
			SysDeal.loadUserStatus(request, response, aWebForm);
			return actionMapping.getInputForward();
		}
		
	 }
}
